package com.beidouapp.manager.impl;

import java.util.List;
import java.util.Map;

import com.beidouapp.dao.PrjProgressSummaryMapper;
import com.beidouapp.domain.pojo.PrjProgressSummary;

import org.apache.ibatis.session.RowBounds;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

import com.beidouapp.dao.ProjectMapper;
import com.beidouapp.domain.pojo.PrjProgress;
import com.beidouapp.domain.pojo.Project;
import com.beidouapp.manager.ProjectManager;
@Repository
public class ProjectManagerImpl implements ProjectManager{
	@Autowired
	ProjectMapper projectMapper;
	@Autowired
	PrjProgressSummaryMapper  prjProgressSummaryMapper;

	@Override
	public List<Project> findProjectByMap(Map<String, Object> params,
			Integer offset, Integer limit) {
		 
		return projectMapper.findProjectByMap(new RowBounds(offset, limit), params);
	}

	@Override
	public Integer findProjectCountByMap(Map<String, Object> params) {
		return projectMapper.findProjectCountByMap(params);
	}

	@Override
	public Project getProjectById(String id) {
		 
		return projectMapper.getProjectById(id);
	}

	@Override
	public List<PrjProgress> findPrjProgressByMap(Map<String, Object> params) {
		// TODO Auto-generated method stub
		return projectMapper.findPrjProgressByMap(params);
	}

	@Override
	public Integer save(Project project) {
	Integer	id=projectMapper.save( project);
		return id;
	}

	@Override
	public void update(Project project) {
		projectMapper.update(project);
	}

	@Override
	public void savePrjProgress(PrjProgress prjProgress) {
		projectMapper.savePrjProgress(prjProgress);
		
	}

	@Override
	public void updatePrjProgress(PrjProgress prjProgress) {
		projectMapper.updatePrjProgress(prjProgress);
	}

	@Override
	public List<PrjProgressSummary> listPrjProgressSummary() {
		return prjProgressSummaryMapper.selectByExample(null);

	}

	@Override
	public Project getOnAndOffLineMan(Project project) {
		// TODO Auto-generated method stub
		return projectMapper.getOnAndOffLineMan(project);
	}

	@Override
	public PrjProgress getPrjProgressById(String id) {
		// TODO Auto-generated method stub
		return projectMapper.getPrjProgressById(id);
	}

	@Override
	public PrjProgress getMaxFollowTimePrj(String id) {
		// TODO Auto-generated method stub
		return projectMapper.getMaxFollowTimePrj(id);
	}

}
